package com.cyl.h5.controller;

import com.cyl.manager.pms.domain.entity.ProductCategory;
import com.cyl.manager.pms.service.ProductCategoryService;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(description = "产品分类查询")
@RestController
@RequestMapping("/no-auth/category")
public class H5CategoryController {

    @Autowired
    private ProductCategoryService categoryService;

    @ApiOperation("产品分类类型")
    @GetMapping("/all-categories")
    public R<List<ProductCategory>> allCategories() {
        return R.ok(categoryService.h5Categories());
    }


//    @ApiOperation("产品分类二级列表")
//    @GetMapping("/category-by-id")
//    public R<List<ProductCategory>> getBrotherAndChild(@RequestParam Long id, @RequestParam(name = "withChild", defaultValue = "false") boolean withChild) {
//        return R.ok(categoryService.getBrotherAndChild(id, withChild));
//    }


}
